import datetime

from lib.response import response
from . import db

class user(db.Model):
    __tablename__ = "user"
    user_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    username = db.Column(db.String(100), unique=True, nullable=False)
    password = db.Column(db.String(100), nullable=True)
    email = db.Column(db.String(100), nullable=True)
    host_info = db.relationship("host", backref="user_info")

class host(db.Model):
    __tablename__ = "host"
    host_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    hostname = db.Column(db.String(100), unique=True, nullable=False)
    username = db.Column(db.String(100), db.ForeignKey('user.username'), nullable=False)

